package hardware;


public class FunctionalUnit {

	String type;
	int id;
	boolean reserved;
	boolean empty;
	
	public FunctionalUnit(String t) {
		type = t;
		empty = true;
		reserved = false;
	}
	
	public boolean reserve() {
		reserved = true;
		return true;
	}
	
	public boolean add() {
		empty = false;
		return true;
	}
	
	public boolean free() {
		reserved = false;
		empty = true;
		id =0;
		return true;
	}	
	
	public String toString(){
		return id + " " + reserved;
	}

}
